import http from './http';

// 获取未完成文件列表
export const getPendingFilesApi = (pageNum = 1, pageSize = 10) => {
  return http({
    method: 'post',
    url: '/file/pending',
    data: { pageNum, pageSize },
  });
};

// 获取已完成文件列表
export const getCompletedFilesApi = (pageNum = 1, pageSize = 10) => {
  return http({
    method: 'post',
    url: '/file/completed',
    data: { pageNum, pageSize },
  });
};

// 获取格式错误文件列表
export const getErrorFilesApi = (pageNum = 1, pageSize = 10) => {
  return http({
    method: 'post',
    url: '/file/error',
    data: { pageNum, pageSize },
  });
};

// 删除文件
export const deleteFileApi = (fileId) => {
  return http({
    method: 'post',
    url: `/file/delete/${fileId}`,
  });
};

// 下载文件
export const downloadFileApi = (fileId) => {
  return http({
    method: 'get',
    url: `/admin/system/sysDoc/download/result/${fileId}`,
    responseType: 'blob', // 用于文件下载
  });
};